from odoo import api, fields, models, _


class Settle_accounts(models.Model):
    _name = 'check.accounts'
    _description = "结账离店"


    house_id = fields.Many2one(
        'check.house',
        '主客房间',
    )

    guest_id = fields.Many2one(
        related='house_id.guest_id',
        string="主客姓名",
        readonly = True

    )

    discount_way = fields.Char(
        '优惠方案'
    )

    dis_way = fields.Char(
        '促销优惠'
    )

    should_Money = fields.Monetary(
        '应收总额',
        'currency_id'
    )

    currency_id = fields.Many2one('res.currency', default=lambda self: self.env.user.company_id.currency_id,)  # price helper

    total_Money = fields.Monetary(
        '消费总额',
        'currency_id',
        related='guest_id.Total_consume'
    )

    dis_money = fields.Monetary(
        '优惠总额',
        'currency_id',
    )

    already_pay = fields.Monetary(
        '已付押金',
        'currency_id'
    )

    odoo_Id = fields.Char(
        '结账单号',
        related='guest_id.odoo_Id'
    )

    guest_odoo = fields.Char(
        '客户签单',
    )

    should_pay = fields.Monetary(
        '还应支付'
        'currency_id'
    )

    guest_pay = fields.Monetary(
        '宾客支付',
        'currency_id'
    )

    pay_line = fields.Char(
        '支付明细'
    )

    note = fields.Char(
        '结账备注'
    )



